Fixing loggin bug