Problem with AC/DC power supply
You've wired your capacitor up the wrong way round: -



I've marked the correct polarity in red. Some electrolytic caps may work once with the wrong polarity but a 2nd time probably not.

Alternatively, and using your own words: -


  While I switch it to DC it still works just fine.Then I discharged
  capacitor and changed the switchs positions to AC


That would certainly cause problems - discharging the cap before disconnecting the bridge is really not the thing to do.

So, given the two errors so far there's every possibility that you've wired the switch up incorrectly or made some other wiring error.....

Yes, there it is in your 2nd picture - you just CANNOT cross-wire a bridge rectifier like that: -



This will put AC on the capacitor.