Fix Refocus bug

Fixed bug where changing windows and returning would halt the bot.