added checks to make sure that we aren't dealing with uninitialized data