add assertion to catch possible edge case
clean up debug messages