fix field to handle null values properly