missing function bug fixed