Define local frame dynamically