Add timeout functionality

Change-Id: I328ef7b66dff5cd9041a2faed8f9072dc0928a98