Adding a NPE and modified the test to test it