fixed function
changed check file exist fucntion