Changed up connection handling. (Works now?)