ArrayIndexOutOfBound Exception because improper setting of properties