changed implementation of flashmessage