fixing problem read/write persmision