Fixed missing return value from function