updated scan functions for begincapture and beginscan