adding cleanup function

Change-Id: I304b46d9ca1d91b471fb65364612afc8e4ebbfdf