Bugfix, does not log sometimes