close window if database does not exists