added functionality to open files