fixed bug with values not being saved properly in database~