cleanup and permissions