added db schema
handling errors properly