Fix StackOverFlow on certificate method