Made it to work with more then 1 element per page