Fixes #87

Fixes #87 
guard against NPE