QAART-368 Fixing the issue that switching frame causing a run time error