improved colission check