added log4j logging, improved unittest for indexExists