Added loading indicator and better filtering logic