Changed to named function instead of anon in a var