Add callback in addDatabase function and timeout management

could you change essay to attempt?