fix option handling bug