Improving lib, safety measures for a flag