ref #5. Works fine if size limit not setted else exists some bugs
ref #5. Works fine with limits
some refactor