resolve error and database