change warehouse connection logic

change warehouse connection logic