add missing return in function