Added destropy function in init to take care of memory deallocation