fixing function missing return value