reading obj from array based on the script