added intval() to limit/offset for extra security