When pressing both the key then releasing any1 key then the anination is not played

i give the running animation to the character and created a flip script…when press A then player move and flip to leff and animation is played ….when press D then player move and flip to write and animation is played.. ..when i press both A and B Simultanious then animation is played but when pressing both at the same time and release one key the player moves in that direction but the animation is not playing.. how to fix that

here the script of running animation

here the script of fliping