Fix permission and remove unnecessary file creation