releasing allocated memmory