Added realm to hash function