updated rendering method in controller