fixing read, empty/full flags