added missing next() in example
added tofo comments, added https support, added security check