detect logic code done