solved RuntimeError bug