function return statement and file name cleaning