implemented pause game functionality on ESC and tab switch