Fixing loading.gif bug