added loading image and logic for show / hide