Patch for NullPointerException error