fixed wrong variable assignment
added visitor tracking