use getFlash helper

Fix issue for getting flash message