add support for one frame lookahead