Added Null pointer exceptions