fixed undefined errors. fixed host= check to be ' host='