fix limit function, it's just great