bugfix on reading