add select file logic