fixed problem where errors were both shown at once