added capture function