bug fixes to logging stuff, needs some help still though