Restart script solves java.lang.NullPointerException