Developing an EEG-based on-line closed-loop lapse detection and mitigation system | Synapse