Add advanced state transitions handler