bug fix

Fixed error when clicking outside of window