fix small bug in sameHeight() function