removed unnecessary error-check that was doing invalid read