add  collision funciton
fix both update