refractored show_by_id method