switched to a more stable subprocess handling