Make it work even for symlinked files