added code to show loading gif during grid construction