add flash functionality