*fixed issue with logToFile call causing error when controller was not set to $log_to_file = true