Added states for actions and fixed some issues