Added offset and limit to databse query