small fix when search or limit is on and ordering not