Added support to auto generate states for modals