fixed usage of isTimeout, as it also checks that err is not nil