Minor bug fix

> Cannot refer to non-final variable shell inside an inner class defined
in a different method