better logging
refine connect