added conditional for widget registration