fixing an enormous bug in bundle state change