variable checking added
major refactor to support different userowner per certificate