changed the way parameters are passed to flash methods
added some magic code that is supposed to prevent the flash message from displaying before loading finished