Added focus event

exposed the focus event.
Minor code corrections.