Added error checking to theme for id 0 and id greater than size of array