added basic timeout detection