added alloc size check check