cleanup & debug