zscore length check was in wrong location