fixed bug with equals method