added clock to save frames