implemented unit switching in new dialog