adding a loading dialog