close on escape and blur