Made database work