fixed sed command changes mode of target file - #314