fixed, no longer has null pointer and connects correctly