implemented fixes for error handling during execution process
adding to targetfunction check to see if it need to be replaced by execute