move callDetail() inside writeToLog()