Creation of input[type=hidden] now above :selected check

I found a slight error when trying to use selected options. This change seems to fix the issue. Cheers!