added basic collision check