Added a null check in CheckRemove