Fixed animation flipping issue