replaced printStackTrace with log.error