Added flash functionality