prevent error in edge case in remove