fixed reading files with utf8 encoded chars
fixed broken script