rewrite this function

rewrite this function that return file join with path + filename