fixed recalculateFrame