added flag retrieval