collision check added