state design pattern added