rewrite frame apply