fix flags validation