Changed getSchema procedure