added some modifications to the select function and added seen in the view function