upload: 500 error instead of incorrect 400