implement frame state saving