fixing subprocess bug