added capture functionality