improved logging timing