convert function finished