Resolve the add provider bug and edit contract bug