fixing output issue
still fixing logging and output