handle loss of focus gracefully