bugfixing for external interrupt
resolved merge conflict