improved flash messages functionalities