added a parameter for logging