prevent page refresh on state change