Fix animation code for ios7