move timeout into wait method