fixed indentation error; added timeout