updates for handling multiple elements