fixed reference to $element