added some debugging/exception handling for states
adding more keys