fixed a runtime error