implemented last_error_type, refs #78
fixed db save of last_error_type, refs #78