*added functions to inser and update in database