use GLOBALS instead of db, fix message bug for new ticket