Override hashCode method where equals has been overridden