Add callback in addDatabase function