looping was object comparing python issue