Fixed error in equals method