cleanup and is_setup flag to prevent some callbacks