add equals and hashCode function