free and modify bug