Added missing function() statements