fixed the max size check