changed animation function