Added target funtion checking