Added handling of Poll threads

Script now works on threads that are Polls.