now allocating dynamic memory for global variable using ScMalloc