Fixed bug targetElement bug

Forgot to define targetElement