more safety and cleanup