Fixed the weird animate() bug