added session handling, fixed edit candidate method