Sets up guard