change the creation of pointer array to avoid crashing on g++/Linux