update ticks and state when it changes