working on database set function