trying to fix end of run error