US Senate agrees to amend gun law