fixed controller to support different schemas