add midnight mode support