Fixed for loop in getstatus()