fix bug causing "target" option not to work