Fix NPE
Fix error
So far
Main part