Fix animation when using key board