add state pattern