move from global declaration to shmalloc