Unity 3D – Why does my button need to be clicked twice to work?

My goal is to go back and forth between a series of animations by clicking left and right arrow UI buttons. I wrote this C# script and the "next" button (which executes AddInt() on click) works as intended, however the "previous" button (which calls ReduceInt() on click), needs to be clicked twice to work. Is this a glitch or is something wrong with my code?

public class update_animator_parameter_int : MonoBehaviour {     Animator gameobject_animator;     public string int_parameter;     public int max_int;     public int current_int=0;      void Start(){         gameobject_animator = GetComponent<Animator>();}      public void AddInt(){           current_int++;           if (current_int > max_int){current_int = 0;}           gameobject_animator.SetInteger(int_parameter, current_int);}       public void ReduceInt(){           current_int--;           if (current_int < 0){current_int = max_int;}           gameobject_animator.SetInteger(int_parameter, current_int);} }