the same, but works with stat
almost works