crete js module for flash messages