added subprocess error handle