fixed some bugs with targeting