fix logger variable name
remove duplicate require
call callback on connection error