update theme table and some logic