Fixing directional animation code