Error in upload don't make js error + some improvements