error checking and messing with log4j