Support undefined json.

fixed #12
use a function for `isOpen`
0.2.5