moved misplaced return statement