fix assigning variable before definition bug

found while doing the DBS3 reader test. (I wonder we ever tested DBS3 reader since the bug is very first steps of using DBS3 reader).
@ericvaandering  please review