added frontend logic to the surveys