improved collision handling algorithm(still unstable)