fixing exception in the function parseOutput