implement capture to file feature