fixing bugs on method calling typestate check