Added interrupt check (press escape to interrupt execution)