check if frame element exists before cehecking for the frame's id