undefined value should not be set as null into db