misplaced endif stopping raise option from showing sometimes