fixed flash messages and added upload support