used getData method instead of directly calling subprocess