state pattern added