Return array instead of cursor to template