Fixed collision code