add trial limits and last prompt, and quit the system properly