fixes controller JSON parsing code