delete allocated memory