added a new function for read