fixed a runtime exception