fix created directory and permissions