added loading functionality as well as a clear button