added functionality to focusLost

made it work