**To Do**: - Before creating new top-level frames, check if the frame already exists. When the frame exists, do not re-create it.
To Do: