add irq and fix terminal problem