moving isset test to same place as others