fix usage of read