Fix NullPointerException in static 'insertData' method