added ajax loading and pagination funz