Are you sure that this if statement compares the objects correctly ?