add recording and replay