fix buggy return statement