stdout was not initialized if exception happened
was using range that does not exist in shell