fixed a minor bug in runlocal method