I must say I don't understand what you are asking here and the code snippets you provide are not helping In future, try and create a reprex and be a bit clearer in your request and we might be able to help.
If you indeed have solved your issue yourself, please mark your post as the solution.