Add previous > 0 condition
Change the way to clear query parameter map