Missing return at end of function