fix syntax errors
cleanup on connection error.