improve frame script