Fix ui crash.