init script and cleanup