Fixed collision detection

Change-Id: Id0878c0958527655b38c993eb69b2fed05f98187