Added function timeout