fix error staying when it should not