changed $element to $id