Collision sensors

I have a sphero bolt and trying to code it so that when it collides it turns around, and then continues with original movement coded on start program. I am having some difficulties and it doesn’t always realise it’s colliding (usually works the first time then stops working). Is there anything I should change or add? Thanks!