added set and get for waiting flag
merged