added feature to show error on element