set ran to true before function run