fix mode parsing