fix animation

thanks to mahal tertin
http://stackoverflow.com/a/19424622/1067147