more robust subprocess calls