Fixed loggin bug