smj error checking and formatting