fixed bug when changing focus by clicking on certain GUI elements