fatal error in charModel, line 17. 'db' not an object?