undefined bug fix