handle log after document load