Added a flashmessage listener