fix checkbox state not being saved to db