fix many bugs add flash for message