fix 'has' method to support non-undefined values