reverted to using subprocess