correct initialization of flags