Added method to close connection. Closes #12