update with mysql db and bug fix for last update