removes extra end bracket