Update model.class.php

Fixing the setting and resetting of connections