switch to use file? instead of stat