Use proper error logging and add the schema and default