adding controller guard functionality