Fix bug when no upload directory exists