Added guard and configured it to use spring