Fix a bug that prevented from opening .txt/.log files