kw fix
Changing != to == when checking for NULL