ooops. fixing endrun bug