Try moving cancel of focus event to earlier in code