fixing collission detection