collision detection
added above collision detection