More correct version of interrupt, but still not working for some cases