Fix bug in updatePage; also fix bug of not updating the page when the array from getData() changes (rows added/removed)