fixed standard error output and standard output bug