change table and fix code