upload document fixes