Fixed no error when no database is selected