adapt to CherryPy multithreading