action glitch

I’m making a platformer, and I set up my character with an action with frame 1 facing right, and frame 2 facing left. Than I set up an actuator so when I press ‘d’ frame 1 is played, and when I press ‘a’ frame 2 is played. the action brick for left has start and end frames set to two, and vice versa for the right action brick. When I play, everything works fine but when I move left, for a single frame it shows the frame where the character faces right. Heres a video to show what I mean and heres the .blend if it helps untitled.blend (504 KB)