fixed a bug where program crashes if the database is not present