added line in crafty.js to fix animation bug