updated to support clustering