switch (backButtonState)Did you mean to switch using the state or the counter ?
switch (backButtonState)