copying file to temp directory