adding integrity check && fix remove_dependency issue