Fixed result being returned twice