Handled timeout errors
Added configurable timeout value