Added console protection snippet