Every time we run test the program we get a NULL pointer exception. There is static variable being assigned to NULL and then being assigned to another value. Please call the static declaration function of the variable before assigning it to another value.
Thanks for pointing out the error. The program works now.