Add loading icon functionality