allocate pointer outside