Merged main code and DB chnages