fix error where size check doesn't work