removing unused variables
replacing printstacktrace to ERROR LOGGER.