added exit on init and window creation errors