updated database by using methods in database class