added max into db