handles NULL in db