added loading gif and cdb functionality