replace last undefined with real undefined