fixed bug on read operation