Added async switch and the cleanup