sorting works using ajax