I\'m using the following code however it is creating multiple connections when calling the map function and they are not closing. As a result my rds database is getting floo