bugfix for readfile