fix getouput -o bug, should test it further