debug the nullpointer from getperiodof value