Bug fix for logger, thanks to @nitinbali60