fixed lumpy error checking