Fix connect bug