Fix undefined id bug.