added a few checks to produce cleaner output