NPE fix
eternal loop fix