update enter bug &edge detection