added a method to detect reassignment of mut vars