fix colliaion logic