added exit func and made lm-error shit the bed