fix permissions and script file