added buggy collision detection