Added dynamic fuctionality to dropdown menu