fixing unexpected end