array out of bounds exception fixed