handled some corner cases