modified read func