added 'nlimit'

and better exception handling