fixed error output conditional