added element parameter to widget constructors to make sure existing elements are reused