Set permissions to the file correctly