added subprocess support to invoke commands