added dynamic change of states