added better property checking