Save to the db functionality added