undefinied bug fix