adds more consistent error propagation when accessing the database