Fixed: omitted to close the connection to MongoDB leading to ‘too many open files..’ error.