upload and delete attachment fixes