Fixed loading of database