this condition added to check if $target is available in page or not, if not available, log in console and returns false