Added attribute focusManaged
Making closebutton focusable
Finished revised code