added function on db