added sample
fixed nullpointer