Add method setFlash
fixed bug