updated listing_controller for conditional links