add timeout and log errors