fixed script

script is fixed reading writing