Removed unnecessary ndefined check