First change flag and then try doing stuff..

- Cause before flag was not changed on error