Correct use of setFlash()