call fn in cleanup