fixes undefined error