added initial collision checking