v1.0.2: fix bug where result could be nil