not sure why udef doesn't work, a workaround