fix bug for first reading