ERP-304 - Fixed close connection to prevent any exceptions from raising.