used null instead of empty object for if statements