added a null check, should fix #68