I cannot say anything about the integration of any function in the MainUI. But this is how I solved the problem.