try catch for log()