fix bug in subprocess call