fix for "limit is not defined"