Moved done to prevent async issues