added average function to question show view