fix incorrect position for memorysize check