addedd exception handeling for get_security_group