fixed bug in nbrs flag code