fixed some loss tracking bugs