cleanup and signature checking