Added null pointer exceptions