Fixing bug in viewTemplate where the latest schema was got