Fixed missing function error and cleaned up available