Whoops, corrected location of cleanup function