Added a timeout method