Adding code to detect target and render on frame