Added userId to checkinstates table.