changed database and added database tests