method for saving into db created