fixed openended bug