fixed null pointer error

Change-Id: Idbfca5b64372b1d72a7bbf0ea9b7ae8ab770a058
added missing lang()

Change-Id: Ie5d421f6bb0584eb30e3f642a584f85a4bd7bdc0
simplifying code

Change-Id: I641dd13bace8c2233b7410264252d69a588c655c