added missing brackets in exists condition