fixed pb with flags