passing element to setTitle instead of index and refactored build files