fixed logical problem in switch statement and added missing logic for NOTIFY, OPTIONS support