change the animate function