added the code for the log