cleanup missing brackets