Checking pointers for NULL value added