Added remove layer feature in unload function.