Added save function to save database entries