Fixed mem alloc mistake