updates to fix some additional issues
added error hook
use instance hooks