check if given output is available always fails, need to fix that