Validated database schema

added null pointer exception and replaced getobject with getstring