fixed minor bug in isSame()