fixed small bug in choosing the sam file to read