bugfix for file exist check