rewritten limit check once more (dry)