added log4j, fixed some issues