Fixed access to the database and added the async module