fix stack hazard