added closing timeout