change approach to recive entities hash code