Bug fix on sess_read function