Added subprocess handling in dispatcher