added upload function and form