fix stupid mistake with flag reference