Made changes to create thread folder if it does not exist, rather than only creating if it is new and does not exist.
Added thread counter
fixed placement of new counter