split the detect fragment from main