fixed the logging in bug