use a flag instead, much easier