added loading file funtionality