bugfix flagcheck