fixed typo and added releaseConnection calls