impelement statemachine for compatibility mode