fixing some errors witht he logging.