Fixed doubled output

When errors occure the output is doubled.