fix init loading and cleanup