only check file stat if file exists