moddified logging a bit