Animation added for smoother transitions