Added a method to limit the parsing length