better .hasKey() method