modified setFlash