fix bug with method calls on state