handle output of subprocess