removed undefined check