Modify is_framed() so it returns boolean value
Fix frame check and strange "parent is undefined" issue