bugfix, provide separate flag for closed state, without it connection could get into incorrect state if _open method fail in a middle