updated to support multiple widgets