Check the target attribute and respond accordingly

Patch for Issue #99