check for undefined selectedFrame