add reason table and modifyed ams and database