uid check, cleanup