added some exception catching and logging code to uploads