moved a return statement around