fixed bug from missing return statement