updated database, fixed some bugs