make sure user and pass are set and add logging