js fixes for upload