Bug fix: added a NULL check