add callbacks for selection and file opening