added more verbose logging on state switches