Hotfix if statment to hasOwnProperty checking