check if val is undefined