override the equals method