infinite loop in step control, use inner class?