added page switching to threads