probably fixed innerFrame greater than outerFrame Bug
renamed wrongly named variable