updated to actually save to database