Null pointer Exception : Indexing change