adding state change animations