more checking to ensure data being saved is valid