fixed error on max size check

for some reason the exception should be thrown and terminates the
program but it is silently caught somewhere, to be investigated