add timeout feature

Change-Id: Ia3e95e5aa2583b041aab562bad4138522783a87f