make sure there's a valid unit before initializing
copy window title when creating ui window

Not copying the string seemed to cause some jankiness on occaision.