check for offset_in and limit_in before converting to int