bugfix in read in function