add timeout and additional error logging