fixed buggy animation flipping