Add checking of undefined