dice - adding code to save in db