extra checking and improvements