insert and update methods were added for databas