modify trap_dispatch and finish Exercise5