trying to find a looping bug