put back commented out flags checks