code for blur and focus kept separate