Add support of flags
* flags are now set relative to the database