Fixed bug in conneciton error.