fix db scripts and some cosmetic on front end