Changed errors to use console.error and added DB update log