Changed order so 'all' is not queried before finding if username exists.