added condition to set limit & offset keys