add callback in addDatabase function