Changed rendering code to use render_to_response