made rake states reader more robust