make callback in connect optional