null/undefined check fix