checked whether the database existed and if it was successful