Added collision check