closes #17 - add a check for null reference to an issue