khanhbq: finish all function. Wait for template