adding close icon and loading iamges on click