prepare frame