added flash functionality