Addressed scoping issue with parent.frame()