Fixed data undefined error.