better window handling. now with success message inside an html.