fixed an issue with return typestate