remove debug statements, check for null units attribute