avoid possible dangling pointer
provide hash function