updated hashCode and equals based on id