Fixed upload which was using wrong name and also displayed error message when upload fails