fixed bug in isSame()