DB functions now throw errors instead of just returning