added time out error handling