add method timeout callback; replace some forEach to for loop