fixed type errors on flags

prioritise middle of goal