fixed issue where limit needs to come before offset