add support for using entities as keys