fix bug for readn