some helper functions in DB