Fix logging in callback