added a clause to catch underfined references