fixed some errors in AKS code