handle functions and nulls