fixed bug when equals is called with different type as parameter