solved null ptr exception