Added function to set and unset flash message and type after timeout.