fixes for key flag