Fixed Javscript errors

Upload still broken. Function does not have scope of uploadOptions
object