Updated equals method of Task