fixed bug in pre-open check and test all switch posibilities